package com.duowei.diandan.bean;


public class JycsszAndWmlsbjb {

    private String csbh;
    private String wmdbh;

    public String getCsbh() {
        return csbh;
    }

    public void setCsbh(String csbh) {
        this.csbh = csbh;
    }

    public String getWmdbh() {
        return wmdbh;
    }

    public void setWmdbh(String wmdbh) {
        this.wmdbh = wmdbh;
    }

//    public static String querySql(String csbh) {
//        return "SELECT a.csbh, a.csmc, b.jysj jcsj, b.ys, b.zh, b.jcrs, b.wmdbh, b.by5 " +
//                "    FROM jycssz a, wmlsbjb b " +
//                "    WHERE " +
//                "            ((((charindex('@' + a.csmc + ',', '@' + b.zh) > 0) OR (charindex(',' + a.csmc + ',', b.zh) > 0)) AND b.sfyjz <> '1' AND " +
//                "    b.wmdbh IN (SELECT DISTINCT wmlsb.wmdbh " +
//                "            FROM wmlsb)) OR " +
//                "            (((charindex('@' + a.csmc + ',', '@' + b.zh) > 0) OR (charindex(',' + a.csmc + ',', b.zh) > 0)) AND " +
//                "    b.wmdbh IN (SELECT DISTINCT wmdbh " +
//                "            FROM JCZTB))) AND CSBH = '" + csbh + "'|";
//    }

    public static String querySql(String csbh) {
        return "SELECT a.csbh, b.jysj jcsj, b.ys, b.zh, b.jcrs, b.wmdbh, b.by5, by12 " +
                "FROM jycssz a, wmlsbjb b " +
                "WHERE " +
                "  (((charindex('@' + a.csmc + ',', '@' + b.zh) > 0) OR (charindex(',' + a.csmc + ',', b.zh) > 0)) AND b.sfyjz <> '1' AND " +
                "  b.wmdbh IN (SELECT DISTINCT wmlsb.wmdbh " +
                "              FROM wmlsb)) AND csbh = '" + csbh + "' " +
                "UNION " +
                "SELECT a.csbh, b.jysj jcsj, b.ys, b.zh, b.jcrs, b.wmdbh, b.by5, by12 " +
                "FROM jycssz a, wmlsbjb b " +
                "WHERE " +
                "  (((charindex('@' + a.csmc + ',', '@' + b.zh) > 0) OR (charindex(',' + a.csmc + ',', b.zh) > 0)) AND b.sfyjz <> '1' AND " +
                "  b.by12 = 1) AND csbh = '" + csbh + "' " +
                "UNION " +
                "SELECT a.csbh, b.jysj jcsj, b.ys, b.zh, b.jcrs, b.wmdbh, b.by5, by12 " +
                "FROM jycssz a, wmlsbjb b " +
                "WHERE " +
                "  (((charindex('@' + a.csmc + ',', '@' + b.zh) > 0) OR (charindex(',' + a.csmc + ',', b.zh) > 0)) AND " +
                "  b.wmdbh IN (SELECT DISTINCT wmdbh " +
                "              FROM JCZTB))  AND csbh = '" + csbh + "'|";
    }
}
